package com.ji.li.reactadminproexampleservice.entity.auth;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.util.ArrayList;
import java.util.List;

/**
 * 授权 角色组
 */
@TableName(value = "interface_auth_role_table")
public class AuthRole {
    public Long getrId() {
        return rId;
    }

    public String getName() {
        return name;
    }

    public String getDescription() {
        return description;
    }

    public List<AuthUserRole> getUserRoles() {
        return authUserRoles;
    }

    public void setrId(Long rId) {
        this.rId = rId;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public void setUserRoles(List<AuthUserRole> authUserRoles) {
        this.authUserRoles = authUserRoles;
    }

    @TableId(value = "r_id",type = IdType.AUTO)
    private Long rId;

    @Override
    public String toString() {
        return "Role{" +
                "rId=" + rId +
                ", name='" + name + '\'' +
                ", description='" + description + '\'' +
                ", userRoles=" + authUserRoles +
                '}';
    }

    @TableField(value = "name")
    private String name;
    @TableField(value = "description")
    private String description;

    /**
     * 有哪些用户 拥有 这个权限（角色组）
     */
    private List<AuthUserRole> authUserRoles = new ArrayList<>();

    public AuthRole(String name, String description) {
        this.name = name;
        this.description = description;
    }
}
